// MorseUtils.h

#ifndef _MORSEUTILS_h
#define _MORSEUTILS_h

#if defined(ARDUINO) && ARDUINO >= 100
	#include "arduino.h"
#else
	#include "WProgram.h"
#endif

class MorseUtils {
private:
	const char* letters = "**ETIANMSURWDKGOHVF?L?PJBXCYZQ??54?3???2??+????16=/?????7???8?90?????????????_????\"??.????@????-????????;!???????,????:";
	unsigned int buffer = 0;
	unsigned short bufferLen = 0;
	unsigned short maxLen = 6;
public:
	char Decode(unsigned int c, unsigned short len);
	unsigned int Encode(char c, unsigned short* len);
	void Push(unsigned int* code, unsigned short val, unsigned short* len);
	void FireDit();
	void FireDah();
	char GetRst();
};
#endif
